#include <stdio.h>
#include <string.h>

int main() {
    char s[110];
    scanf("%s", s);
    int len = strlen(s), ans = 1, ansi = 0, ansj = 0;
    for (int i = 0; i < len; i++) {
        for (int j = 0; j < i; j++) {
            if (i == j)
                continue;
            int p1 = i, p2 = j, b = 1;
            while (p1 > p2) {
                if (s[p1] != s[p2]) {
                    b = 0;
                    break;
                }
                p1--;
                p2++;
            }
            if (b && ans < i - j + 1) {
                ans = i - j + 1;
                ansi = i;
                ansj = j;
            }
        }
    }
    for (int i = ansj; i <= ansi; i++) printf("%c", s[i]);
}